﻿using System;

namespace SubtitlesCleaner
{
    class SubtitleFormatException : ApplicationException
    {
        public static void Write(string name)
        {
            string message = string.Format("{0}:   {1}", Resources.FileFormatError, name);
            Program.status = System.Windows.Forms.MessageBoxIcon.Error;
            throw new Exception(message);
        }

        public static void Write(string name, string line)
        {
            string message = string.Format("{0}:\n   {1}\n{2}:\n   {3}", 
                Resources.FileFormatError, 
                name, 
                Resources.FileFormatErrorInLine, 
                line);

            Program.status = System.Windows.Forms.MessageBoxIcon.Error;
            throw new Exception(message);
        }
    }
}
